package cn.kgc.ffzw.day17.homework.animal;

public class TestAnimal {
    public static void main(String[] args) {
        Animal animal=new Dogs();

        if(animal instanceof  Dogs){
            Dogs dogs=(Dogs)animal;
            dogs.catchFlyDisk();
        }else if(animal instanceof Penguins){
            Penguins p=(Penguins)animal;
            p.swim();
        }

    }
}
